import os
from PIL import Image

path = r'C:\Users\ylj\Desktop\111\aaa'
outputPath = r'C:\Users\ylj\Desktop\111\outputImg'

os.mkdir(outputPath)

imgs = os.listdir(path)

for img in imgs:
    if((img.find('jpg') != -1) or (img.find('JPG') != -1)):
        fullName = path + os.sep + img
        fullOutName = outputPath + os.sep + img
        print(fullOutName)
        im = Image.open(fullName,"r")
        im_resize = im.copy()
        im_resize = im_resize.resize((750,1050))
        im_resize.save(fullOutName,quality=95)
input("完成！")
